package com.atguigu;

import redis.clients.jedis.Jedis;

import java.util.Set;

public class Redis_Jedis {
    public static void main(String[] args) {
        //1.获取redis客户端链接
        Jedis jedis = new Jedis("hadoop102", 6379);


//        System.out.println(jedis.ping());

        //写数据
        //String
//        jedis.set("0409", "very good");
        //Set
//        jedis.sadd("220409Set", "liangliang", "pengpeng", "ruirui","ruirui","ruirui");

        //读数据
//        String
//        System.out.println(jedis.get("0409"));
        //Set
        Set<String> smembers = jedis.smembers("220409Set");
        System.out.println(smembers.toString());

        //关闭链接
        jedis.close();
    }
}
